<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/pages/safeai/jsp/common/taglibs.jsp"%>
<%@ taglib uri="/WEB-INF/FCKeditor.tld" prefix="FCK"%>
<html>
	<head>
		<title></title>
		<%@ include file="/pages/safeai/jsp/common/meta.jsp"%>
		<link href="${ctx}/css/safeai/together.css" rel="stylesheet" type="text/css">
		<script type="text/javascript" src="${ctx}/js/DateTimeCalendar.js"></script>
	</head>
	<body> 
		<html:form action="job.do?method=addJob" method="post" enctype="multipart/form-data"> 
			<input type="hidden" name="sg.jobtype" value="mail"/>
			<table width="700px" align="center">
				<tr>
					<th colspan="2" class="td_01" height="25px">
						 邮件群发
					</th>
				</tr>
				<tr>
					<td  class="td_01">
						发送时间：
					</td>
                    <td class="td_04"><input name="sg.date" type="date" id="Txt_SDateTime"  onfocus="calendar();"/></td>
				</tr>
				<tr>
					<td class="td_01">
						邮件标题
					</td>
					<td class="td_04">
						<input type="text" name="sg.title" id="title"/>
					</td>
				</tr> 
				<tr>
					<td class="td_01">
						内容：
					</td>
					<td class="td_04">
						<FCK:editor id="sg.contents" basePath="${ctx}/FCKeditor/" width="99%" height="500px"
							defaultLanguage="zh-cn" toolbarSet="catalog" tabSpaces="8"
							imageBrowserURL="${ctx}/FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/pages/safeai/jsp/connector"
							linkBrowserURL="${ctx}/FCKeditor/editor/filemanager/browser/default/browser.html?Connector=connectors/pages/safeai/jsp/connector"
							flashBrowserURL="${ctx}/FCKeditor/editor/filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/pages/safeai/jsp/connector"
							imageUploadURL="${ctx}/FCKeditor/editor/filemanager/upload/simpleuploader?Type=Image"
							linkUploadURL="${ctx}/FCKeditor/editor/filemanager/upload/simpleuploader?Type=File"
							flashUploadURL="${ctx}/FCKeditor/editor/filemanager/upload/simpleuploader?Type=Flash">
		              
		  			</FCK:editor>
					</td>
				</tr> 
				<tr>
					<td class="td_01">选择导入的文件：</td>
					<td class="td_04"><html:file property="sg.file"/></td>
				</tr>
				<tr><td colspan="2" align="center"><input type="submit" class="btn" value="提交" onclick="return sub();"/></td></tr>
				<tr align="center" >
					<td colspan="2"><span style="font-family:'宋体'; font-size:12px; color:#FF0000">${jobMsg}</span></td>
				</tr>
			</table> 
		</html:form>
	</body>
</html>
<script language="javascript"> 
	function sub(){
		 var date = document.getElementById("Txt_SDateTime").value;
		 var contents = document.getElementById("contents").value;
		 var files = document.getElementById("sg.file").value; 
		 var title = document.getElementById("title").value;
		 
		 if(date == ""){
		 	alert("请输入日期!");
		 	document.getElementById("date").focus();
		 	return false;
		 }
		 
		  if(title == ""){
		 	alert("请输入发送标题!");
		 	document.getElementById("title").focus();
		 	return false;
		 }
		 
		 if(contents == ""){
		 	alert("请输入发送内容!");
		 	document.getElementById("contents").focus();
		 	return false;
		 }
		 
		  if(files == ""){
		 	alert("请选择上传文件!"); 
		 	return false;
		 }
		 return true;
	}
</script>
